package com.dai.bean;

public class ZaoWanData {

    // 表示早晚
    public  enum Time{
        ZAO(1),
        WAN(2);

        private int value;
        private Time(int value){
            this.value = value;
        }
        public int getValue(){
            return  value;
        }

        public static Time getTime(int val){
            switch (val){
                case 1:
                    return ZAO;
                case 2:
                    return WAN;
                default:
                    throw new RuntimeException("undefine val:" + val);
            }
        }
    }

    public  enum State{
        NormalDaKa(1), // 正常打卡
        BuKa(2), // 补卡
        TimeNotYet(3), // 时间未到
        AlreadyDaKa(4); // 已经打卡

        private  int value;
        private State(int value){
            this.value = value;
        }
        public int getValue(){
            return value;
        }

        public static State getState(int val){
            switch (val){
                case 1:
                    return NormalDaKa;
                case 2:
                    return BuKa;
                case 3:
                    return TimeNotYet;
                case 4:
                    return  AlreadyDaKa;
                default:
                    throw new RuntimeException("undefine val:" + val);
            }
        }
    }

    private Time time;  // 早上打卡 还是 晚上打卡
    private State state;  // 当前状态

    public ZaoWanData() {
        time = Time.ZAO;
        state = State.TimeNotYet;
    }

    public ZaoWanData(State state,Time time) {
        state = this.state;
        time = this.time;
    }

    public Time getTime() {
        return time;
    }

    public void setTime(Time time) {
        this.time = time;
    }

    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
    }
}